home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / AIAT / Headers / Corpus / SentCorpus.h < prev    next >
Encoding:
Text File  |  1998-04-16  |  1.8 KB  |  75 lines  |  [TEXT/CWIE]

  1. // SentCorpus.h
  2. //    Copyright:    © 1994 - 1998 by Apple Computer, Inc., all rights reserved.
  3. // A corpus that contains just one document. It treats each sentence as a document.
  4. // Used for document summarization.
  5.  
  6. #pragma once
  7. #ifndef SentCorpus_h
  8. #define SentCorpus_h
  9.  
  10. #pragma import on
  11.  
  12. #if PRAGMA_STRUCT_ALIGN
  13.     #pragma options align=power
  14. #endif
  15.  
  16. #include "StringCorpus.h"
  17.  
  18. #pragma IA_BEGIN_EXPORTS
  19.  
  20. const uint32    IASentenceCorpusType = 'Snt0';
  21.  
  22. class RankedHit;
  23.  
  24. class SentenceDoc : public StringDoc {
  25. public:
  26.         SentenceDoc(byte* txt, uint32 len, uint32 sentenceNumber, uint32 paragraphNumber,
  27.                     uint32 rank=0, RankedHit* hit = NULL);
  28.         SentenceDoc() : StringDoc(), fSentenceNumber(0), fRank(0), fParagraphNumber(0), fHit(NULL) {}
  29.         virtual        ~SentenceDoc();
  30.  
  31.         IAStorable*    DeepCopy() const;
  32.         uint32        StoreSize() const;
  33.         void        Store(IAOutputBlock* output) const;
  34.         IAStorable*    Restore(IAInputBlock* input) const;
  35.  
  36.         bool        LessThan(const IAOrderedStorable* neighbor) const;
  37.         bool        Equal(const IAOrderedStorable* neighbor) const;
  38.         
  39.  
  40.         void         SetRank(uint32 rank) {fRank = rank;}
  41.         void        SetRankedHit(RankedHit* rh) {fHit = rh;}
  42.         
  43.         uint32        GetSentenceNumber() const {return fSentenceNumber;}
  44.         uint32         GetRank() const {return fRank;}
  45.         uint32        GetParagraphNumber() const {return fParagraphNumber;}
  46.         RankedHit*    GetRankedHit() const {return fHit;}
  47.         
  48. private:
  49.         uint32        fSentenceNumber;
  50.         uint32        fRank;
  51.         uint32        fParagraphNumber;
  52.         RankedHit*    fHit;
  53. };
  54.  
  55.  
  56. class SentenceCorpus : public IACorpus {
  57. public:    
  58.                 SentenceCorpus() : IACorpus(IASentenceCorpusType) {};
  59. //                SentenceCorpus(SentenceCorpus& fc) : IACorpus(fc) {};
  60.             virtual     ~SentenceCorpus() {}; 
  61.                 IADoc*    GetProtoDoc();
  62.                 IADocText*    GetDocText(const IADoc* doc);
  63. };
  64.  
  65. #pragma IA_END_EXPORTS
  66.  
  67. #if PRAGMA_STRUCT_ALIGN
  68.     #pragma options align=reset
  69. #endif
  70.  
  71. #pragma import reset
  72.  
  73. #endif
  74.  
  75.